﻿@model IEnumerable<MVC_Person.Models.Person>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")

        @using (Html.BeginForm()){   
         <p> CompanyID: @Html.TextBox("searchID") 
         <input type="submit" value="Filter" /></p>
        }
</p>
<table>
    <tr>
        <th>
            Contact_role
        </th>
        <th>
            CompanyID
        </th>
        <th>
            Job_title
        </th>
        <th>
            Job_start
        </th>
        <th>
            Job_end
        </th>
        <th>
            Comments
        </th>
        <th>
            Email
        </th>
        <th>
            Cell_phone
        </th>
        <th>
            Office_fax
        </th>
        <th>
            Office_phone
        </th>
        <th>
            Prefix
        </th>
        <th>
            First_name
        </th>
        <th>
            Last_name
        </th>
        <th>
            Suffix
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Contact_role)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CompanyID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Job_title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Job_start)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Job_end)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Comments)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Cell_phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Office_fax)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Office_phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Prefix)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.First_name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Last_name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Suffix)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.PersonID }) |
            @Html.ActionLink("Details", "Details", new { id=item.PersonID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.PersonID })
        </td>
    </tr>
}

</table>
